package com.lfq.createXml;

import java.io.File;

import org.w3c.dom.Element;

public class TestXml {

	public static void main(String[] args) {
		Element note = XmlUtils.createRootElement("note");
		XmlUtils.appendElement(note, "to", "George1");
		XmlUtils.appendElement(note, "from", "John2");
		XmlUtils.appendElement(note, "heading", "Reminder1");
		XmlUtils.appendElement(note, "body", "Don't forget the meeting!");
		
		XmlUtils.saveToXml(note, new File("/home/lv-success/Desktop/temp.xml"));
		
		//使用xml生成工具生成java代码(控制台输出)
		File file = new File("/home/lv-success/Desktop/temp.xml");
		XmlUtils.createJavaCode(file);
	}

}
